const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))







Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    addButton:true,
    Refresh:false,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    
    listConfig: [
        {
          label: '反馈类型',
          prop: 'type',
          jsonType: typeJson.type,
        },
        {
          label: '反馈内容',
          prop: 'contenct',
          
        }
      ],
    
    
 
      formConfig: [
     
        {
          label: "反馈类型",
          prop: "type",
          jsonType: typeJson.type,
          type: 'dropDown',
          required:true,
        },
       
        {
          label: "反馈内容",
          prop: "contenct",
          type:"textarea",
          required:true  
        },

        {
          label: "申请时间",
          prop: "createTime",
          type: "dateTime",
          required: true,
        },



        ],
    
        
        net: {
       
            select: {
              url: `/app/advise/list`,
              method: 'get',
              data: {
      
              }
            },
            delete: {
              url: '/app/siteMeeting/delete',
              method: 'post',
              data: {
                
              }
            },
            insert: {
              url: '/app/advise',
              method: 'post',
              data: {
                userId:prolist.userId,
                status:0
              }
            },
            update: {
              url: '/app/feedback/insert',
              method: 'post',
              data: {
  
              }
            } 
        },
        showCom:true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
   
    
    this.setData({
      showCom:false
    })

    this.setData({
      showCom:true
    })
  },

 

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '刷新中...',
    })
    this.setData({
      Refresh:true
    })
    wx.hideLoading();
    wx.stopPullDownRefresh()
    this.setData({
      Refresh:false
    })
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})